package qianFeng.day2;

import java.util.Scanner;

public class AgeNumeration {
    public static void main(String[] args) {
        int age;
        System.out.print("请输入年龄：");
        age=new Scanner(System.in).nextInt();
        System.out.print("火车票优惠方式为：");
        new TextAge().age_judge(age);
    }
}
class TextAge{
    public void age_judge(int age){
        if(age<18)
            System.out.println("火车票半价！");
        else if (age<60)
            System.out.println("火车票无优惠，全票！");
        else
            System.out.println("免票！");
    }
}
